home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / os2tools / bnklysrc / b_sbinit.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-02-25  |  8.3 KB  |  215 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*                                                                          */
  4. /*      ------------         Bit-Bucket Software <no-Inc>                   */
  5. /*      \ 10001101 /         Writers and Distributors of                    */
  6. /*       \ 011110 /          No-Cost<no-tm> Software.                       */
  7. /*        \ 1011 /                                                          */
  8. /*         ------                                                           */
  9. /*                                                                          */
  10. /*  Copyright (C) 1987, 1988, 1989 by Robert Hartman and Vincent Perriello  */
  11. /*                                                                          */
  12. /*                                                                          */
  13. /*            This module was originally written by Bob Hartman             */
  14. /*                                                                          */
  15. /*                                                                          */
  16. /*                  BinkleyTerm Initial Fullscreen Setup                    */
  17. /*                                                                          */
  18. /*                                                                          */
  19. /*    For complete  details  of the licensing restrictions, please refer    */
  20. /*    to the License  agreement,  which  is published in its entirety in    */
  21. /*    the MAKEFILE and BT.C, and also contained in the file LICENSE.210.    */
  22. /*                                                                          */
  23. /*    USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    */
  24. /*    BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    */
  25. /*    THIS  AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,  OR IF YOU DO    */
  26. /*    NOT HAVE THESE FILES,  YOU SHOULD  IMMEDIATELY CONTACT THE AUTHORS    */
  27. /*    AT THE  ADDRESSES LISTED BELOW.  IN NO EVENT SHOULD YOU PROCEED TO    */
  28. /*    USE   THIS  FILE  WITHOUT  HAVING   ACCEPTED  THE  TERMS  OF   THE    */
  29. /*    BINKLEYTERM  LICENSING AGREEMENT,  OR SUCH OTHER  AGREEMENT AS YOU    */
  30. /*    ARE ABLE TO REACH WITH THE AUTHORS.                                   */
  31. /*                                                                          */
  32. /*                                                                          */
  33. /*    The Authors can be reached at the following addresses:                */
  34. /*                                                                          */
  35. /*    Robert C. Hartman                      Vincent E. Perriello           */
  36. /*    Spark Software                         VEP Software                   */
  37. /*    427-3 Amherst Street                   111 Carroll Street             */
  38. /*    CS2032, Suite 232                      Naugatuck, CT 06770            */
  39. /*    Nashua, NH 03061                                                      */
  40. /*                                                                          */
  41. /*    FidoNet 1:132/101                      FidoNet 1:141/491              */
  42. /*    Data    (603) 888-8179                 Data    (203) 729-7569         */
  43. /*                                                                          */
  44. /*    Please feel free to contact us at any time to share your comments     */
  45. /*    about our software and/or licensing policies.                         */
  46. /*                                                                          */
  47. /*--------------------------------------------------------------------------*/
  48.  
  49. #include <time.h>
  50. #include <string.h>
  51.  
  52. #include "com.h"
  53. #include "xfer.h"
  54. #include "zmodem.h"
  55. #include "keybd.h"
  56. #include "sbuf.h"
  57. #include "sched.h"
  58. #include "externs.h"
  59. #include "prototyp.h"
  60.  
  61. void b_sbinit ()
  62. {
  63.    vfossil_init ();
  64.    scr_printf ("\033[H\033[2J");
  65.    sb_init ();
  66.    wholewin = (REGIONP) sb_new (0, 0, 23, 80);
  67.    settingswin = (REGIONP) sb_new (1, 1, 7, 22);
  68.    historywin = (REGIONP) sb_new (1, 23, 7, 23);
  69.    holdwin = (REGIONP) sb_new (1, 46, 7, 33);
  70.    callwin = (REGIONP) sb_new (8, 1, 10, 78);
  71.    filewin = (REGIONP) sb_new (18, 1, 4, 78);
  72.  
  73.    sb_fill (wholewin, ' ', colors.background);
  74.    sb_fill (settingswin, ' ', colors.settings);
  75.    sb_fill (historywin, ' ', colors.history);
  76.    sb_fill (holdwin, ' ', colors.hold);
  77.    sb_fill (callwin, ' ', colors.call);
  78.    sb_fill (filewin, ' ', colors.file);
  79.  
  80.    sb_box (settingswin, boxtype, colors.settings);
  81.    sb_box (historywin, boxtype, colors.history);
  82.    sb_box (holdwin, boxtype, colors.hold);
  83.    sb_box (callwin, boxtype, colors.call);
  84.    sb_box (filewin, boxtype, colors.file);
  85.  
  86.    sb_move (settingswin, 0, 1);
  87.    sb_puts (settingswin, " Current Settings ");
  88.  
  89.    sb_move (historywin, 0, 1);
  90.    sb_puts (historywin, " Today at a Glance ");
  91.  
  92.    sb_move (holdwin, 0, 1);
  93.    sb_puts (holdwin, " Pending Outbound Mail ");
  94.  
  95.    sb_move (holdwin, 3, 7);
  96.    sb_puts (holdwin, "Initializing System");
  97.  
  98.    sb_move (callwin, 0, 1);
  99.    sb_puts (callwin, " Recent Activity ");
  100.  
  101.    sb_move (filewin, 0, 1);
  102.    sb_puts (filewin, " Transfer Status ");
  103.  
  104.    sb_move (wholewin, 0, 1);
  105.    sprintf (junk, "Node: %d:%d/%d.%d", alias[0].Zone, boss_net, boss_node,
  106.          (boss_net == alias[0].Net) ? 0 : alias[0].Node);
  107.    sb_puts (wholewin, junk);
  108.    sb_move (wholewin, 0, 79 - strlen (system_name));
  109.    sb_puts (wholewin, system_name);
  110.  
  111.    bottom_line ();
  112.  
  113.    sb_move (settingswin, SET_EVNT_ROW, 2);
  114.    sb_puts (settingswin, "Event:");
  115.    sb_move (settingswin, SET_PORT_ROW, 2);
  116.    sb_puts (settingswin, "Port: ");
  117.    sb_move (settingswin, SET_STAT_ROW, 2);
  118.    sb_puts (settingswin, "Status: Init");
  119.  
  120.    do_today ();
  121.  
  122.    settingswin->sr0 = settingswin->r0 + 1;
  123.    settingswin->sr1 = settingswin->r1 - 1;
  124.    settingswin->sc0 = settingswin->c0 + 1;
  125.    settingswin->sc1 = settingswin->c1 - 1;
  126.  
  127.    historywin->sr0 = historywin->r0 + 1;
  128.    historywin->sr1 = historywin->r1 - 1;
  129.    historywin->sc0 = historywin->c0 + 1;
  130.    historywin->sc1 = historywin->c1 - 1;
  131.  
  132.    holdwin->sr0 = holdwin->r0 + 1;
  133.    holdwin->sr1 = holdwin->r1 - 1;
  134.    holdwin->sc0 = holdwin->c0 + 1;
  135.    holdwin->sc1 = holdwin->c1 - 1;
  136.  
  137.    callwin->sr0 = callwin->r0 + 1;
  138.    callwin->sr1 = callwin->r1 - 1;
  139.    callwin->sc0 = callwin->c0 + 1;
  140.    callwin->sc1 = callwin->c1 - 1;
  141.  
  142.    filewin->sr0 = filewin->r0 + 1;
  143.    filewin->sr1 = filewin->r1 - 1;
  144.    filewin->sc0 = filewin->c0 + 1;
  145.    filewin->sc1 = filewin->c1 - 1;
  146. }
  147.  
  148. void do_today ()
  149. {
  150.    char j[30];
  151.  
  152.    if (fullscreen)
  153.       {
  154.       sb_move (historywin, HIST_BBS_ROW, 2);
  155.       sb_puts (historywin, "BBS/Mail:  ");
  156.       sprintf (j, "%d/%d", hist.bbs_calls, hist.mail_calls);
  157.       sprintf (junk, "%-8.8s", j);
  158.       sb_puts (historywin, junk);
  159.  
  160.       sb_move (historywin, HIST_ATT_ROW, 2);
  161.       sb_puts (historywin, "Calls Out: ");
  162.       sprintf (junk, "%-6d", hist.calls_made);
  163.       sb_puts (historywin, junk);
  164.  
  165.       sb_move (historywin, HIST_CONN_ROW, 2);
  166.       sb_puts (historywin, "Successes: ");
  167.       sprintf (junk, "%-6d", hist.connects);
  168.       sb_puts (historywin, junk);
  169.  
  170.       sb_move (historywin, HIST_FILE_ROW, 2);
  171.       sb_puts (historywin, "Files I/O: ");
  172.       sprintf (j, "%d/%d", hist.files_in, hist.files_out);
  173.       sprintf (junk, "%-8.8s", j);
  174.       sb_puts (historywin, junk);
  175.  
  176.       sb_move (historywin, HIST_LAST_ROW, 2);
  177.       sb_puts (historywin, "Last: ");
  178.       }
  179.  
  180.    last_type (hist.last_caller, hist.last_zone, hist.last_net, hist.last_node);
  181. }
  182.  
  183. void bottom_line ()
  184. {
  185.    if (fullscreen)
  186.       {
  187.       sb_move (wholewin, 22, 0);
  188.       sb_putc (wholewin, ' ');
  189.       sb_puts (wholewin, ANNOUNCE);
  190. #ifdef OVERLAYS
  191.       sb_puts (wholewin, "-Overlay");
  192. #endif
  193.       sb_move (wholewin, 22, 57);
  194.       sb_puts (wholewin, "Press Alt-F10 For Help ");
  195.       }
  196. }
  197.  
  198. void put_up_time ()
  199. {
  200.    struct tm *tp;
  201.    time_t ltime;
  202.  
  203.    if (fullscreen && (un_attended || doing_poll))
  204.       {
  205.       time (<ime);
  206.       tp = localtime (<ime);
  207.       sb_move (settingswin, SET_TIME_ROW, SET_TIME_COL);
  208.       sprintf (junk, "%s %s %02d @ %02d:%02d",
  209.                wkday[tp->tm_wday], mtext[tp->tm_mon], tp->tm_mday,
  210.                tp->tm_hour, tp->tm_min);
  211.       sb_puts (settingswin, junk);
  212.       sb_show ();
  213.       }
  214. }
  215.